<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增流程定义')"/>
    <th:block th:include="include :: datetimepicker-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-flowdefine-add">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">流程名称：</label>
            <div class="col-sm-8">
                <input name="flowName" class="form-control" type="text" maxlength="32" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">流程类型：</label>
            <div class="col-sm-8">
                <select name="flowType" class="form-control m-b" th:with="type=${@dict.getType('workflow_flow_type')}"
                        required>
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">流程说明：</label>
            <div class="col-sm-8">
                <textarea name="flowDesc" class="form-control" maxlength="256" required></textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">流程状态：</label>
            <div class="col-sm-8">
                <select name="sts" class="form-control m-b" th:with="type=${@dict.getType('workflowsts')}" required>
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">独立法人机构：</label>
            <div class="col-sm-8">
                <select name="deptId" class="form-control m-b" th:with="type=${@dept.selectDeptListByType('2')}"
                        required>
                    <option value="">请选择</option>
                    <option th:each="dept : ${type}" th:text="${dept.deptName}" th:value="${dept.deptId}"></option>
                </select>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">
    var prefix = ctx + "workflow/flowdefine"
    $("#form-flowdefine-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-flowdefine-add').serialize());
        }
    }

    $("input[name='upTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
</script>
</body>
</html>